home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / RGASM.RAR / ASMCODE.EXE / CHAPT12 / GETSCAN.ASM < prev    next >
Encoding:
Assembly Source File  |  1993-05-10  |  797 b   |  23 lines

  1. ;
  2. ;       Program GetScan ( Chapter 12 )
  3. ;
  4. code    segment word public 
  5.     public GetScan
  6. assume  cs:code
  7. GetScan Proc    far pascal, Prompt: byte, SpInd: far ptr byte
  8.     mov     ah,02
  9.     mov     dl,Prompt
  10.     int     21h
  11.     les     bx,SpInd                ; effective address of SpInd into ES:BX
  12.     mov     byte ptr es:[bx],0      ; SpInd := False
  13.     mov     ah,01h                  ; function 01h - accept character
  14.     int     21h                     ; DOS service call
  15.     cmp     al,0                    ; special key pressed?
  16.     jne     ExSubr                  ; if not, return to caller
  17.     mov     byte ptr es:[bx],1      ; SpInd := True
  18.     int     21h                     ; DOS service call
  19. ExSubr: ret                             ; return to calling program
  20. GetScan endp    
  21. code    ends
  22.     end
  23.